#ifndef _WEBSOCKET_PACKET_PARSING_H
#define _WEBSOCKET_PACKET_PARSING_H

#include "Clib.h"
#include <stdint.h>

#define		GET_OK						(1)
#define		GET_NOK						(0)
#define		WEBSOCKET_FIN_RSV			(uint8_t*)"fin_rsv"
#define		WEBSOCKET_OPCODE			(uint8_t*)"opcode"
#define		WEBSOCKET_MASK				(uint8_t*)"mask"
#define		WEBSOCKET_PAYLOAD_LEN		(uint8_t*)"payload_len"
#define		WEBSOCKET_MASK_KEY			(uint8_t*)"mask_key"
#define		WEBSOCKET_EXTENDED_PAYLEN	(uint8_t*)"extened_paylen"
#define		WEB_DATA					(uint8_t*)"data"

uint32_t get_websocket_packet_head(uint8_t *packet, uint8_t *keyword);
int get_websocket_packet_data(uint8_t *packet, uint8_t *buf);
int check_websocket_packet_rece_finish(uint8_t *packet, uint32_t len);

#endif
